package cn.kingyang.yiyi.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.jtech.view.RecyclerHolder;

import cn.kingyang.yiyi.R;
import cn.kingyang.yiyi.app.App;
import cn.kingyang.yiyi.mvp.model.bean.HomeInfo;
import cn.kingyang.yiyi.ui.adapter.base.BaseAdapter;
import cn.kingyang.yiyi.utils.AppUtil;


/**
 * Created by Administrator on 2017/1/7.
 */

public class VideoAdapter extends BaseAdapter<HomeInfo.TrialBean> {

    public VideoAdapter(Context context) {
        super(context);
    }

    @Override
    protected View createView(LayoutInflater layoutInflater, ViewGroup viewGroup, int i) {
        return layoutInflater.inflate(R.layout.item_home,null);
    }

    @Override
    protected void convert(RecyclerHolder recyclerHolder, HomeInfo.TrialBean video, int i) {
        AppUtil.initImage(getContext(),recyclerHolder.getView(R.id.video_imageview),video.getThumb());
        recyclerHolder.setText(R.id.video_title, video.getTitle());
        recyclerHolder.setText(R.id.video_play_count, video.getViews()+1*100+"次播放");
        recyclerHolder.setText(R.id.video_quality, "画质：高清");
        if (App.level>0)
            recyclerHolder.hideViewGone(R.id.tag);

    }
}
